package form.ui.core
{
	public class Border extends ProgrammaticSkin
	{		
		public function Border()
		{
			super();
		}
		
		override public function invalidateDisplayList():void
		{
			var bw:Number = this.width;
			var bh:Number = this.height;
			if(borderWidth == 1)
			{
				bw -= 1;
				bh -= 1;
			}
			graphics.clear();			
			graphics.lineStyle(borderWidth, borderColor, borderAlpha);			
			graphics.drawRect(0,0,bw,bh);
		}
		
		private var _borderWidth:uint = 1;
		public function get borderWidth():uint
		{
			return _borderWidth;
		}
		public function set borderWidth(value:uint):void
		{
			if(_borderWidth != value)
			{
				_borderWidth = value;
				invalidateDisplayList();
			}
		}
		
		private var _borderColor:uint = 0xFFFFFF;
		public function get borderColor():uint
		{
			return _borderColor;
		}
		public function set borderColor(value:uint):void
		{
			if(_borderColor != value)
			{
				_borderColor = value;
				invalidateDisplayList();
			}
		}
		
		private var _borderAlpha:Number = 1;
		public function get borderAlpha():uint
		{
			return _borderAlpha;
		}
		public function set borderAlpha(value:uint):void
		{
			if(_borderAlpha != value)
			{
				_borderAlpha = value;
				invalidateDisplayList();
			}
		}
		
		
		
	}
}